package com.atguigu.yygh.hosp.controller;/*
 * @author: XueYouPeng
 * @time: 2023/6/11 15:29
 */

import com.atguigu.common.result.Result;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController // 后台管理系统的接口/admin/开头
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;

    @GetMapping("findDeptList/{hoscode}")
    public Result findDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list = departmentService.findDeptList(hoscode);
        return Result.ok().data("list",list);
    }
}
